﻿/**
 * 
 * F. Mehmet ARSLAN (c) 2015
 * fmehmetarslan46@gmail.com
 *  
 **/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Xml.Serialization;

namespace ServiceState.Models
{
    [Serializable]
    public class Service
    {
        [System.Xml.Serialization.XmlAttribute("id")]
        public String Id { get; set; }
        [System.Xml.Serialization.XmlAttribute("description")]
        public String Description { get; set; }
        [System.Xml.Serialization.XmlAttribute("url")]
        public String Url { get; set; }
        [System.Xml.Serialization.XmlAttribute("method")]
        public Method Method { get; set; }
        [System.Xml.Serialization.XmlAttribute("protocol")]
        public Protocol Protocol { get; set; }
        [XmlArray("childservices")]
        [XmlArrayItem("service", typeof(Service))]
        public List<Service> ChildService { get; set; }
        [XmlIgnore]
        public String getUrl
        {
            get
            {
                StringBuilder url = new StringBuilder();
                url.Append(Protocol.ToString());
                url.Append("://");
                url.Append(Url);
                return url.ToString();
            }
        }
        [XmlIgnore]
        public HttpStatusCode StatusCode { get; set; }
        [XmlIgnore]
        public String LongDescription { get; set; }
    }
}